<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>站内信 - 用户中心 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }

        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }

        .header-right {
            display: flex;
            align-items: center;
        }

        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }

        .header-action:hover {
            color: var(--primary-color);
        }

        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }

        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-menu {
            padding: 16px 0;
        }

        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
        }

        .page-actions .btn {
            margin-left: 10px;
        }

        /* 站内信区域 */
        .messages-container {
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            height: calc(100vh - 180px);
        }

        /* 消息列表侧边栏 */
        .messages-sidebar {
            width: 280px;
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
        }

        .messages-sidebar-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .btn-compose {
            width: 100%;
            justify-content: center;
        }

        .folders-list {
            padding: 16px 0;
            flex: 1;
            overflow-y: auto;
        }

        .folder-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .folder-item:hover {
            background: rgba(52, 152, 219, 0.05);
            color: var(--primary-color);
        }

        .folder-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .folder-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        .folder-badge {
            margin-left: auto;
            background: var(--primary-color);
            color: white;
            font-size: 12px;
            padding: 2px 6px;
            border-radius: 10px;
        }

        /* 消息列表 */
        .messages-list-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            border-right: 1px solid var(--border-color);
            width: 400px;
        }

        .messages-list-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .messages-list-title {
            font-size: 16px;
            font-weight: 500;
        }

        .search-box {
            position: relative;
        }

        .search-input {
            padding: 8px 12px 8px 36px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            width: 200px;
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
        }

        .messages-toolbar {
            padding: 12px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 12px;
            background: #f9fafc;
        }

        .messages-list {
            flex: 1;
            overflow-y: auto;
        }

        .message-list-item {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .message-list-item:hover {
            background: rgba(52, 152, 219, 0.05);
        }

        .message-list-item.active {
            background: rgba(52, 152, 219, 0.1);
        }

        .message-list-item.unread {
            background: rgba(52, 152, 219, 0.03);
        }

        .message-checkbox {
            margin-right: 12px;
        }

        .message-sender-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 12px;
            flex-shrink: 0;
        }

        .message-list-content {
            flex: 1;
            min-width: 0;
        }

        .message-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }

        .message-sender {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .message-time {
            font-size: 12px;
            color: var(--text-muted);
            flex-shrink: 0;
            margin-left: 8px;
        }

        .message-subject {
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 4px;
        }

        .message-preview {
            font-size: 13px;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .message-list-actions {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-left: 12px;
        }

        .message-star {
            color: var(--text-muted);
            cursor: pointer;
            margin-bottom: 8px;
        }

        .message-star.starred {
            color: var(--warning-color);
        }

        .message-attachment {
            color: var(--text-muted);
        }

        .message-unread-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--primary-color);
            margin-left: 12px;
            flex-shrink: 0;
        }

        /* 消息阅读区域 */
        .message-view {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 0;
        }

        .message-view-header {
            padding: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .message-view-subject {
            font-size: 20px;
            font-weight: 500;
            margin-bottom: 16px;
        }

        .message-view-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .message-sender-info {
            display: flex;
            align-items: center;
        }

        .message-sender-avatar-large {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 12px;
            font-weight: 500;
            font-size: 18px;
        }

        .message-sender-details h4 {
            font-weight: 500;
            margin-bottom: 4px;
        }

        .message-sender-details p {
            font-size: 13px;
            color: var(--text-muted);
        }

        .message-view-actions {
            display: flex;
            gap: 8px;
        }

        .message-view-body {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            line-height: 1.6;
        }

        .message-view-body p {
            margin-bottom: 16px;
        }

        .message-view-footer {
            padding: 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
        }

        /* 撰写消息模态框 */
        .compose-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 600px;
            background: var(--card-bg);
            border-radius: 4px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            z-index: 1000;
            display: none;
        }

        .compose-modal.open {
            display: block;
        }

        .compose-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .compose-title {
            font-size: 16px;
            font-weight: 500;
        }

        .compose-close {
            background: none;
            border: none;
            font-size: 18px;
            color: var(--text-muted);
            cursor: pointer;
        }

        .compose-body {
            padding: 20px;
        }

        .compose-form .form-group {
            margin-bottom: 16px;
        }

        .compose-form .form-label {
            display: block;
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }

        .compose-form .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
        }

        .compose-form .form-input:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .compose-form .form-textarea {
            min-height: 200px;
            resize: vertical;
        }

        .compose-footer {
            padding: 16px 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .compose-actions {
            display: flex;
            gap: 8px;
        }

        /* 模态框遮罩 */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
            display: none;
        }

        .modal-overlay.open {
            display: block;
        }

        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn i {
            margin-right: 6px;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            background: #f5f7fa;
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 13px;
        }

        .btn-icon {
            width: 32px;
            height: 32px;
            padding: 0;
            justify-content: center;
        }

        .btn-icon i {
            margin-right: 0;
        }

        /* 空状态 */
        .empty-state {
            padding: 60px 20px;
            text-align: center;
            color: var(--text-muted);
        }

        .empty-state i {
            font-size: 64px;
            margin-bottom: 16px;
            color: #d1d5db;
        }

        .empty-state p {
            margin-bottom: 24px;
            font-size: 16px;
        }

        /* 响应式设计 */
        @media (max-width: 1200px) {
            .messages-list-container {
                width: 320px;
            }
        }

        @media (max-width: 992px) {
            .messages-container {
                flex-direction: column;
            }

            .messages-sidebar {
                width: 100%;
                border-right: none;
                border-bottom: 1px solid var(--border-color);
                max-height: 200px;
            }

            .messages-list-container {
                width: 100%;
                border-right: none;
                border-bottom: 1px solid var(--border-color);
                flex: 0 0 300px;
            }

            .message-view {
                flex: 1;
            }

            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }

            .sidebar.open {
                left: 0;
            }

            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }

            .overlay.open {
                display: block;
            }
        }

        @media (max-width: 768px) {
            .compose-modal {
                width: 90%;
            }

            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }

            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }

            .message-view-meta {
                flex-direction: column;
                align-items: flex-start;
            }

            .message-view-actions {
                margin-top: 16px;
                width: 100%;
                justify-content: flex-end;
            }

            .message-view-footer {
                flex-direction: column;
                gap: 16px;
            }

            .message-list-item {
                padding: 12px;
            }

            .message-sender-avatar {
                width: 32px;
                height: 32px;
                margin-right: 8px;
            }
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站平台
            </div>
        </div>

        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>

            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>

            <div class="user-menu">
                <span>张三</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">用户中心</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-user-circle"></i>
                    <span>个人信息</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>账户安全</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-globe"></i>
                    <span>我的网站</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>我的页面</span>
                </a>

                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>我的文章</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>我的产品</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>我的媒体</span>
                </a>

                <div class="menu-title">交易管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-credit-card"></i>
                    <span>我的订单</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-money-bill-wave"></i>
                    <span>支付记录</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-gift"></i>
                    <span>优惠券</span>
                </a>

                <div class="menu-title">消息中心</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-bell"></i>
                    <span>消息通知</span>
                </a>
                <a href="#" class="menu-item active">
                    <i class="fas fa-comments"></i>
                    <span>站内信</span>
                </a>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">站内信</h1>
                <div class="page-actions">
                    <button class="btn btn-outline" id="refreshMessages">
                        <i class="fas fa-sync-alt"></i> 刷新
                    </button>
                    <button class="btn btn-primary" id="composeMessage">
                        <i class="fas fa-edit"></i> 写新消息
                    </button>
                </div>
            </div>

            <!-- 站内信区域 -->
            <div class="messages-container">
                <!-- 消息列表侧边栏 -->
                <div class="messages-sidebar">
                    <div class="messages-sidebar-header">
                        <button class="btn btn-primary btn-compose" id="composeMessageSidebar">
                            <i class="fas fa-plus"></i> 写消息
                        </button>
                    </div>
                    <div class="folders-list">
                        <div class="folder-item active">
                            <i class="fas fa-inbox"></i>
                            <span>收件箱</span>
                            <span class="folder-badge">3</span>
                        </div>
                        <div class="folder-item">
                            <i class="fas fa-paper-plane"></i>
                            <span>已发送</span>
                        </div>
                        <div class="folder-item">
                            <i class="fas fa-edit"></i>
                            <span>草稿箱</span>
                            <span class="folder-badge">1</span>
                        </div>
                        <div class="folder-item">
                            <i class="fas fa-star"></i>
                            <span>标星消息</span>
                        </div>
                        <div class="folder-item">
                            <i class="fas fa-trash"></i>
                            <span>已删除</span>
                        </div>
                    </div>
                </div>

                <!-- 消息列表 -->
                <div class="messages-list-container">
                    <div class="messages-list-header">
                        <div class="messages-list-title">收件箱</div>
                        <div class="search-box">
                            <i class="fas fa-search search-icon"></i>
                            <input type="text" class="search-input" placeholder="搜索消息...">
                        </div>
                    </div>
                    <div class="messages-toolbar">
                        <input type="checkbox" id="selectAllMessages">
                        <label for="selectAllMessages">全选</label>
                        <button class="btn btn-outline btn-sm">
                            <i class="fas fa-trash"></i> 删除
                        </button>
                        <button class="btn btn-outline btn-sm">
                            <i class="fas fa-envelope"></i> 标记为已读
                        </button>
                    </div>
                    <div class="messages-list">
                        <div class="message-list-item unread active">
                            <input type="checkbox" class="message-checkbox">
                            <div class="message-sender-avatar">系</div>
                            <div class="message-list-content">
                                <div class="message-list-header">
                                    <div class="message-sender">系统管理员</div>
                                    <div class="message-time">10:30</div>
                                </div>
                                <div class="message-subject">欢迎使用拖拽建站平台</div>
                                <div class="message-preview">感谢您注册我们的服务，这是一封欢迎邮件...</div>
                            </div>
                            <div class="message-list-actions">
                                <div class="message-star starred">
                                    <i class="fas fa-star"></i>
                                </div>
                                <div class="message-attachment">
                                    <i class="fas fa-paperclip"></i>
                                </div>
                            </div>
                            <div class="message-unread-dot"></div>
                        </div>

                        <div class="message-list-item unread">
                            <input type="checkbox" class="message-checkbox">
                            <div class="message-sender-avatar">王</div>
                            <div class="message-list-content">
                                <div class="message-list-header">
                                    <div class="message-sender">王设计师</div>
                                    <div class="message-time">昨天</div>
                                </div>
                                <div class="message-subject">关于网站设计方案的反馈</div>
                                <div class="message-preview">您好，我已经完成了首页的设计方案，请查收...</div>
                            </div>
                            <div class="message-list-actions">
                                <div class="message-star">
                                    <i class="far fa-star"></i>
                                </div>
                            </div>
                            <div class="message-unread-dot"></div>
                        </div>

                        <div class="message-list-item">
                            <input type="checkbox" class="message-checkbox">
                            <div class="message-sender-avatar">李</div>
                            <div class="message-list-content">
                                <div class="message-list-header">
                                    <div class="message-sender">李技术主管</div>
                                    <div class="message-time">2023-09-01</div>
                                </div>
                                <div class="message-subject">系统更新通知</div>
                                <div class="message-preview">本周六凌晨我们将进行系统维护，预计停机2小时...</div>
                            </div>
                            <div class="message-list-actions">
                                <div class="message-star">
                                    <i class="far fa-star"></i>
                                </div>
                            </div>
                        </div>

                        <div class="message-list-item">
                            <input type="checkbox" class="message-checkbox">
                            <div class="message-sender-avatar">张</div>
                            <div class="message-list-content">
                                <div class="message-list-header">
                                    <div class="message-sender">张客户经理</div>
                                    <div class="message-time">2023-08-28</div>
                                </div>
                                <div class="message-subject">续费提醒</div>
                                <div class="message-preview">您的企业版套餐即将到期，请及时续费...</div>
                            </div>
                            <div class="message-list-actions">
                                <div class="message-star">
                                    <i class="far fa-star"></i>
                                </div>
                                <div class="message-attachment">
                                    <i class="fas fa-paperclip"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 消息阅读区域 -->
                <div class="message-view">
                    <div class="message-view-header">
                        <div class="message-view-subject">欢迎使用拖拽建站平台</div>
                        <div class="message-view-meta">
                            <div class="message-sender-info">
                                <div class="message-sender-avatar-large">系</div>
                                <div class="message-sender-details">
                                    <h4>系统管理员</h4>
                                    <p>发送至: 张三 &lt;zhangsan@example.com&gt;</p>
                                </div>
                            </div>
                            <div class="message-view-actions">
                                <button class="btn btn-outline btn-icon" title="回复">
                                    <i class="fas fa-reply"></i>
                                </button>
                                <button class="btn btn-outline btn-icon" title="转发">
                                    <i class="fas fa-share"></i>
                                </button>
                                <button class="btn btn-outline btn-icon" title="删除">
                                    <i class="fas fa-trash"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="message-view-body">
                        <p>尊敬的张三，</p>

                        <p>欢迎使用拖拽建站平台！我们很高兴您选择我们的服务来创建您的网站。</p>

                        <p>我们的平台提供了简单易用的拖拽式界面，让您无需编码知识也能创建专业级的网站。您可以从数百个精美模板中选择，或者从空白画布开始创作。</p>

                        <p>为了帮助您快速上手，我们为您准备了以下资源：</p>

                        <ul>
                            <li><a href="#">新手入门指南</a> - 了解平台基本功能</li>
                            <li><a href="#">视频教程</a> - 观看实际操作演示</li>
                            <li><a href="#">模板库</a> - 浏览并选择适合您行业的模板</li>
                        </ul>

                        <p>如果您有任何问题或需要帮助，请随时联系我们的客服团队。我们提供7×24小时在线支持。</p>

                        <p>再次感谢您选择我们的服务！</p>

                        <p>祝您使用愉快，<br>
                            拖拽建站平台团队</p>
                    </div>
                    <div class="message-view-footer">
                        <div class="attachments">
                            <div class="form-label">附件</div>
                            <div class="attachment-item">
                                <i class="fas fa-paperclip"></i> 欢迎指南.pdf (2.5MB)
                            </div>
                        </div>
                        <div class="message-actions">
                            <button class="btn btn-outline">
                                <i class="fas fa-reply"></i> 回复
                            </button>
                            <button class="btn btn-outline">
                                <i class="fas fa-share"></i> 转发
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 撰写消息模态框 -->
    <div class="compose-modal" id="composeModal">
        <div class="compose-header">
            <div class="compose-title">写新消息</div>
            <button class="compose-close" id="closeComposeModal">
                <i class="fas fa-times"></i>
            </button>
        </div>
        <div class="compose-body">
            <form class="compose-form">
                <div class="form-group">
                    <label class="form-label">收件人</label>
                    <input type="text" class="form-input" placeholder="输入用户名或邮箱地址">
                </div>
                <div class="form-group">
                    <label class="form-label">主题</label>
                    <input type="text" class="form-input" placeholder="消息主题">
                </div>
                <div class="form-group">
                    <label class="form-label">内容</label>
                    <textarea class="form-input form-textarea" placeholder="输入消息内容..."></textarea>
                </div>
                <div class="form-group">
                    <label class="form-label">附件</label>
                    <input type="file" class="form-input">
                </div>
            </form>
        </div>
        <div class="compose-footer">
            <div class="compose-actions">
                <button class="btn btn-outline">
                    <i class="fas fa-paperclip"></i> 添加附件
                </button>
            </div>
            <div>
                <button class="btn btn-outline">
                    <i class="fas fa-times"></i> 取消
                </button>
                <button class="btn btn-primary">
                    <i class="fas fa-paper-plane"></i> 发送
                </button>
            </div>
        </div>
    </div>

    <!-- 模态框遮罩 -->
    <div class="modal-overlay" id="modalOverlay"></div>

    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 侧边栏切换
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');

            sidebarToggle.addEventListener('click', function () {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });

            overlay.addEventListener('click', function () {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });

            // 文件夹切换
            const folderItems = document.querySelectorAll('.folder-item');

            folderItems.forEach(item => {
                item.addEventListener('click', function () {
                    folderItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');

                    const folderName = this.querySelector('span').textContent;
                    document.querySelector('.messages-list-title').textContent = folderName;

                    // 这里可以添加加载对应文件夹消息的逻辑
                    console.log('切换到文件夹: ' + folderName);
                });
            });

            // 消息项点击
            const messageItems = document.querySelectorAll('.message-list-item');

            messageItems.forEach(item => {
                item.addEventListener('click', function () {
                    messageItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');
                    this.classList.remove('unread');

                    // 更新未读消息计数
                    updateUnreadCount();

                    // 这里可以添加加载消息内容的逻辑
                    const messageSubject = this.querySelector('.message-subject').textContent;
                    document.querySelector('.message-view-subject').textContent = messageSubject;
                });
            });

            // 星标消息
            const messageStars = document.querySelectorAll('.message-star');

            messageStars.forEach(star => {
                star.addEventListener('click', function (e) {
                    e.stopPropagation();
                    this.classList.toggle('starred');

                    const icon = this.querySelector('i');
                    if (this.classList.contains('starred')) {
                        icon.className = 'fas fa-star';
                    } else {
                        icon.className = 'far fa-star';
                    }
                });
            });

            // 撰写消息
            const composeButtons = document.querySelectorAll('#composeMessage, #composeMessageSidebar');
            const composeModal = document.getElementById('composeModal');
            const modalOverlay = document.getElementById('modalOverlay');
            const closeComposeModal = document.getElementById('closeComposeModal');

            composeButtons.forEach(button => {
                button.addEventListener('click', function () {
                    composeModal.classList.add('open');
                    modalOverlay.classList.add('open');
                });
            });

            closeComposeModal.addEventListener('click', function () {
                composeModal.classList.remove('open');
                modalOverlay.classList.remove('open');
            });

            modalOverlay.addEventListener('click', function () {
                composeModal.classList.remove('open');
                modalOverlay.classList.remove('open');
            });

            // 更新未读消息计数
            function updateUnreadCount() {
                const unreadMessages = document.querySelectorAll('.message-list-item.unread');
                document.querySelector('.folder-badge').textContent = unreadMessages.length;
            }

            // 初始化
            updateUnreadCount();
        });
    </script>
</body>

</html>